package common

import (
	"gin/pkg"

	"github.com/jinzhu/gorm"
)

//插入人物生平信息
func InsertPInfo(db *gorm.DB, data pkg.PInfo) {
	err := db.Table("person").Create(&data).Error
	db.Table("person").NewRecord(data)
	pkg.ErrCheck(err)
}

//插入人物关系信息
func InsertPRelation(db *gorm.DB, data pkg.PRelation) {
	err := db.Table("person_relationship").Create(&data).Error
	db.Table("person_relationship").NewRecord(data)
	pkg.ErrCheck(err)
}
